5-E
Simple site for the info you need...
$names = "input.txt"
Import-Module ActiveDirectory
$objInputFileContent = get-content $strInputFileName
foreach ($name in $names) {
write-output $name >>members.txt
write-output `r`n >>members.txt
$((Get-ADUser -Identity $name -Properties *).MemberOf -split (",") | Select-String -SimpleMatch "CN=") -replace "CN=","" >>members.txt
write-output ....... >>members.txt
write-output `r`n >>members.txt
write-output `r`n >>members.txt
}
UserName SamAccount